Skip to content

Apply 'trim_scale' function to results of aggregation to improve compatibility with .NET decimal #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 26, 2025

Conversation

alex-kulakov
Copy link
Contributor

Backport of #435.

PostgreSQL 13+ has built-in function that trims unnecessary zeros in fractional part of numeric/decimals, we apply it because insignificant zeros can overflow inner array of longs in .NET decimal. It also allows to not guess precision and scale which may cause precision loss.

For expressions as columns we cast to decimal first because there is a chance
it should be done because there is internal cast to decimal and this is the
reason that result type of column is decimal,
For simple column expressions we probably don't need cast, just trim
renames and summaries, also fixed wrong logic of property and its use
@alex-kulakov alex-kulakov merged commit e42ab42 into 7.1 Apr 26, 2025
@alex-kulakov alex-kulakov deleted the 7.1-pg-trimscale branch April 26, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant